import request from "@/api/request";
import { type AxiosRequestConfig } from "axios";
import { type DeepRequired } from "../../interface";

/**
 * /project/upload/winning
 */
export function postProjectUploadWinning(params: PostProjectUploadWinningParams, input?: PostProjectUploadWinningInput, config?: AxiosRequestConfig) {
    const paramsInput = {
        id: params.id,
        winningTime: params.winningTime,
        winningAmount: params.winningAmount,
        winningRemark: params.winningRemark,
    };
    return request.post<DeepRequired<any>>(`/project/upload/winning`, input, {
        params: paramsInput,
        ...config,
    });
}

export interface PostProjectUploadWinningParams {
    id: number;
    winningTime?: string;
    winningAmount?: number;
    winningRemark?: string;
}

export interface PostProjectUploadWinningInput {
    file?: File;
}
